﻿<UserControl x:Class="PairingMatrix.View.MingleCardControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:Behavior="clr-namespace:PairingMatrix.View.Behavior" xmlns:Converter="clr-namespace:PairingMatrix.View.Converter" xmlns:AttachedProperty="clr-namespace:PairingMatrix.View.AttachedProperty" mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400" Height="110" Width="140" d:DataContext="{Binding Source={StaticResource ProjectCard}}" Background="White">

    <UserControl.Resources>
        <Converter:BoolToColorHighlightConverter x:Key="boolToColorHighlightConverter"/>    
        <Converter:BoolToVisibilityConverter x:Key="boolToVisibilityConverter"/>    
    </UserControl.Resources>
    
    <Border Visibility="Visible" Opacity="1" Name="CardBorder">
        <Border.Effect>
            <DropShadowEffect BlurRadius="16" Color="{Binding Path=ShowHighlighted, Converter={StaticResource boolToColorHighlightConverter}}" Direction="235" Opacity=".5" ShadowDepth="0" />            
        </Border.Effect>

        <StackPanel x:Name="LayoutRoot" Background="White">
            <Grid Background="#FFF5730A" Height="20">
                <TextBlock x:Name="cardNumber" Text="{Binding Path=CardNumber}" FontWeight="Bold" Margin="5,2,0,0" Foreground="White" FontSize="15"/>
            </Grid>
            <Grid Height="70" >
                <TextBlock Text="{Binding Path=Title}" VerticalAlignment="Stretch" Margin="5,5,5,5" FontSize="14" HorizontalAlignment="Stretch" Height="80" TextWrapping="Wrap"/>
            </Grid>
            <TextBlock Grid.Column="0" Margin="5,2,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Text="{Binding Path=StatusInMingle}" Height="20" Foreground="Blue"/>
        </StackPanel>        
    </Border>
    <UserControl.RenderTransform>
        <TransformGroup>
            <ScaleTransform x:Name="scale" CenterX="60" CenterY="45" ScaleX="1" ScaleY="1"/>
        </TransformGroup>
    </UserControl.RenderTransform>
    <Interactivity:Interaction.Behaviors>
        <Behavior:SetPositionOfMingleCardBehavior />
        <Behavior:OpacityForMingleCardBehavior/>
        <Behavior:MouseOnMingleCardBehavior/>
    </Interactivity:Interaction.Behaviors>
</UserControl>
